package com.internal.Internalhibernate.server.dao;

import java.io.File;
import java.util.Date;
import java.util.List;

import com.internal.Internalhibernate.client.AdmDegree;
import com.internal.Internalhibernate.client.AdmNationalitySerial;
import com.internal.Internalhibernate.client.AdmSemester;
import com.internal.Internalhibernate.client.MlImage;
import com.internal.Internalhibernate.client.MlLicenses;
import com.internal.Internalhibernate.client.MlLicensesId;
import com.internal.Internalhibernate.client.MlQualifications;
import com.internal.Internalhibernate.client.MlQualificationsId;

public class test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		
		
	

		MlLicensesId id = new MlLicensesId();
		id.setProId((short) 28);
		id.setSerialFlag((short)1);
		MlLicenses license = new MlLicenses();
		license.setId(id);
		license.setMlImage(new MlImageDAO().findById((long) 2));
		license.setAdmNationalities(new AdmNationalitiesDAO()
				.findById((short) 1));
		license.setLicenseDate(new Date());
		license.setNameA("محمد");
		license.setAddress("غمره");
		license.setGender(true);
		license.setLicenseType(true);
		license.getId().setLicenseNumber((long) 2);
		license.setSecUsersByUserIdI(new SecUsersDAO().findById("Entry"));
		new MlLicensesDAO().persist(license);
		
		
		MlLicenses retLicence = new MlLicensesDAO().findById(license.getId());
		MlQualificationsId qualId = new MlQualificationsId();
		qualId.setDegId((short) 42 );
		qualId.setLicenseNumber(retLicence.getId().getLicenseNumber());
		qualId.setProId(retLicence.getAdmProfessions().getProId());
		qualId.setSerialFlag((short) 1);
		qualId.setSpeId(3);
		MlQualifications qual = new MlQualifications();
		qual.setId(qualId);
		qual.setQuaYear((short) 2011);
		qual.setSemester("مايو");
		qual.setAdmUniversities(new AdmUniversitiesDAO().findById(159));
		new MlQualificationsDAO().persist(qual);

		
//		AdmSemester sem = new AdmSemester();
//		sem.setSemId((byte) 1);
//		sem.setTitleDesc("مايو");
//		sem.setSemTitle("مايو");
//		new AdmSemesterDAO().persist(sem);

		
	}

}
